<template>
	<view class="cardShadow">
		<template>
			
			<view style="width: 100%;display: flex;">
				<view style="width: 40%;">
					<view class="carPicture">
						<image :src="toImages(item.category.image)" alt="" mode="widthFix"  />
					</view>
				</view>
				<view style="width: 60%;">
					<view class="title">
						{{ item.category[$t('item.name')] || $t("暂无信息") }}
					</view>
					<view class="lineP">
						<view style="flex: 1;">
							<view class="lineP">
								<Tag class="u-margin-bottom-14" :text="$t(item.whole_diffuse) || ''" color="#18cee3">
								</Tag>
								<Tag class="u-margin-bottom-14" :text="item[$t('item.load_num')]+'kg'" color="#008aff"></Tag>
								<Tag class="u-margin-bottom-14" :text="item[$t('item.goods_volume')]+'m³'" color="#18d62a">
								</Tag>
							</view>
							<view class="lineP u-margin-bottom-0">
								<FromToCountry :item="item"></FromToCountry>
							</view>
						</view>
					</view>
					<view class="lineP">
						{{item.car_l + 'm*'  + item.car_w + 'm*'  + item.car_h + 'm' || ''}}
					</view>
				</view>
			</view>
			

			<view class="address" v-if="item.hyd">
				<view class="label">{{$t("出发城市")}}</view>
				<image :src="HTTP_IMG_UTL+'tubiao1.png'" class="headline_img" />
				<view class="u-flex-1">{{item.hyd || $t("暂无信息") }}</view>
			</view>
			
			<view class="address" v-if="item.shd">
				<view class="label">{{$t("到达城市")}}</view>
				<image :src="HTTP_IMG_UTL+'tubiao2.png'" class="headline_img" />
				<view class="u-flex-1">{{item.shd || $t("暂无信息") }}</view>
			</view>
			
			<view class="u-margin-bottom-20" >
				<TransportType :item="item"></TransportType>
			</view>
			
		</template>
		
	</view>
</template>

<script>
	import TransportType from '@/components/TransportType.vue'
	import {
		createC2CConversation,
		isBase64,
		time
	} from "@/common/public";
	import FromToCountry from '@/components/FromToCountry.vue'

	import Tag from '@/components/Tag.vue'
	import {
		IMAGE_URL,
		HTTP_IMG_UTL
	} from "@/config/app";
	export default {
		components: {
			Tag,
			FromToCountry,
			TransportType
		},
		props: {
			item: {
				type: Object,
				default: {},
			},
			type: {
				type: String,
				default: '1',
			},
		},
		computed: {
			toImages() {
				return (src) => {
					return isBase64(src) ? src : IMAGE_URL + src
				}
			},
		},
		data() {
			return {
				HTTP_IMG_UTL
			};
		},
		methods: {
			time
		}
	}
</script>

<style lang="scss" scoped>
	.carPicture {
		display: flex;
		align-items: center;
		height: 260rpx;
		image {
			width: 220rpx;
		}
	}

	.lineP {
		display: flex;
		align-items: center;
		margin-bottom: 8px;
		position: relative;
		font-size: 16px;
		position: relative;
		flex-wrap: wrap;


		&.shot {
			width: 50%;
			flex-wrap: wrap;


		}



		.headline_img {
			width: 30rpx;
			height: 30rpx;
			margin-right: 10rpx;
		}

		.label {
			font-weight: 600;
			margin-bottom: 10rpx;
		}
	}

	.title {
		color: #e43b14;
		font-size: 38rpx;
		// border-top: 1rpx solid #cccccc;
		font-weight: 600;
		margin-top: 10rpx;
		word-break: break-all;
		// min-height: 80rpx;
		margin-bottom: 20rpx;
		text-align: left;
	}
	
	.address {
		margin-bottom: 32rpx;
		font-size: 28rpx;
		position: relative;
		padding-left: 45rpx;
		// font-weight: 600;
	
		// .warp {
		// 	width: 55%;
		// }
	
		.headline_img {
			position: absolute;
			left: 0;
			top: 4rpx;
			width: 30rpx;
			height: 30rpx;
		}
	
		.label {
			font-weight: 600;
			margin-bottom: 10rpx;
			color: #ff7200;
		}
	}
</style>